<template>
	<view class="bg-white">
		<cu-custom bgColor="bg-white" :isBack="true">
			<block slot="content">草稿箱编辑</block>
		</cu-custom>
		<view style="padding: 15px;">
			<view class="action" style="margin-bottom: 10px;">
				<text class="cuIcon-titles " style="color: #1E5EFF;"></text>
				<text style="color: #5A607F;font-size: 25rpx;">
					基础信息新增
				</text>
			</view>
			<view id="topView" style="margin-top: 35rpx;">
				<view style="padding: 0 10rpx;">
					<view class="grid col-4 grid-square flex-sub">
						<view @tap="ChooseImage" v-if="imgList.length == 0"
							style="text-align: center;background: #F5F6FA;border-radius:10px;">
							<text class='cuIcon-add'></text>
							<text
								style="display: inline-block;margin-top: 45px;color: #5A607F;font-weight: 500;font-size: 10px;">
								添加照片
							</text>
						</view>
						<view class="bg-img" style="border-radius:10px;" v-if="imgList.length == 0">
							<image :src="retirmAvatar" mode="aspectFill"></image>
							<image :src="retirmAvatar" mode="aspectFill"></image>
						</view>
						<!-- <view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage"
							style="border-radius:10px;" :data-url="imgList[index]"> 
							<image :src="imgList[index]" mode="aspectFill"></image>-->
							
						<view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage"
							style="border-radius:10px;" :data-url="item">
							<image :src="item" mode="aspectFill"></image>
							<view class="cu-tag addImgStyle" @tap.stop="DelImg" :data-index="index">
								<text class='cuIcon-delete' style="color: #FF3B3B;"></text>
							</view>
						</view>
					</view>
				</view>
				<view class="cu-form-group">
					<view class="title">姓名</view>
<!--					<my-select range-key="text" value-key="value" dict-code="sys_user,realname,id" v-model="userId" />-->
                     <my-seach-select range-key="text" value-key="value" dict-code="sys_user,realname,id" v-model="userId" :isSelect="true" />
				</view>
				<view class="cu-form-group" style="background-color: #F4F4F4;border-radius: 15px;margin-top: 15rpx;">
					<view class="title">性别</view>
					<input v-model="dataObj.sex_dictText" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;" disabled />
				</view>
				<view class="cu-form-group" style="background-color: #F4F4F4;border-radius: 15px;margin-top: 15rpx;">
					<view class="title">年龄</view>
					<input v-model="dataObj.age" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;" disabled />
				</view>
				<view class="cu-form-group" style="background-color: #F4F4F4;border-radius: 15px;margin-top: 15rpx;">
					<view class="title">民族</view>
					<input v-model="dataObj.nation" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;" disabled>
				</view>
				<view class="cu-form-group" style="background-color: #F4F4F4;border-radius: 15px;margin-top: 15rpx;">
					<view class="title">身份证号码</view>
					<input v-model="dataObj.idCard" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;" disabled />
				</view>
				<view class="cu-form-group" style="background-color: #F4F4F4;border-radius: 15px;margin-top: 15rpx;">
					<view class="title">出生年月</view>
					<!-- <input v-model="dataObj.birthday.replaceAll('-','/')" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;" disabled /> -->
						<input v-model="dataObj.birthday" placeholder="请输入" name="input"
							style="text-align:right;font-size: 25rpx;" disabled />
				</view>
				<view class="cu-form-group" style="background-color: #F4F4F4;border-radius: 15px;margin-top: 15rpx;">
					<view class="title">身份证地址</view>
					<input v-model="dataObj.idCardAddress" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;" disabled />
				</view>
				<view class="cu-form-group" style="background-color: #F4F4F4;border-radius: 15px;margin-top: 15rpx;">
					<view class="title">签发机关</view>
					<input v-model="dataObj.idCardIssue" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;" disabled />
				</view>
				<view class="cu-form-group" style="background-color: #F4F4F4;border-radius: 15px;margin-top: 15rpx;">
					<view class="title">身份证有效期</view>
					<!-- <input v-model="dataObj.idCardValidPeriod.replaceAll('-','/')" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;" disabled /> -->
						<input v-model="dataObj.idCardValidPeriod" placeholder="请输入" name="input"
							style="text-align:right;font-size: 25rpx;" disabled />
				</view>
				<view class="cu-form-group" style="background-color: #F4F4F4;border-radius: 15px;margin-top: 15rpx;">
					<view class="title">身份类别</view>
					<input v-model="dataObj.identityCategory_dictText" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;" disabled />
				</view>
				<view class="cu-form-group">
					<view class="title">工号</view>
					<input v-model="dataObj.workNo" placeholder="请输入" name="input" disabled
						style="text-align:right;font-size: 25rpx;" />
				</view>
				<view class="cu-form-group">
					<view class="title">婚姻状况</view>
					<my-select range-key="text" value-key="value" dict-code="marital_status"
						v-model="dataObj.maritalStatus" />
				</view>
				<view class="cu-form-group">
					<view class="title">籍贯</view>
					<input v-model="dataObj.nativePlace" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;">
				</view>
				<view class="cu-form-group">
					<view class="title">学历</view>
					<my-select range-key="text" value-key="value" dict-code="education" v-model="dataObj.education" />
				</view>
				<view class="cu-form-group">
					<view class="title">毕业院校</view>
					<input v-model="dataObj.graduationInstitution" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;"></input>
				</view>
				<view class="cu-form-group" style="padding-right: 4px !important;">
					<view class="title">毕业时间</view>
					<picker mode="date" :value="dataObj.graduationTime"
						@change="DateChangeGraduationTime">
						<view class="picker">
							{{graduationTime ? graduationTime : '请选择'}}
						</view>
					</picker>
				</view>
				<view class="cu-form-group">
					<view class="title">党团员</view>
					<my-select range-key="text" value-key="value" dict-code="party_and_league_members"
						v-model="dataObj.partyAndLeagueMembers" />
				</view>
				<view class="cu-form-group" style="padding-right: 4px !important;">
					<view class="title">进厂时间</view>
					<picker mode="date" :value="dataObj.enterFactoryTime"
						@change="DateChangeEnterFactoryTime">
						<view class="picker">
							{{enterFactoryTime ? enterFactoryTime : ''}}
						</view>
					</picker>
				</view>
				<view class="cu-form-group">
					<view class="title">联系电话</view>
					<input v-model="dataObj.phone" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;"></input>
				</view>
				<view class="cu-form-group">
					<view class="title">现居住地址</view>
					<input v-model="dataObj.currentAddress" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;"></input>
				</view>
				
				<view class="cu-form-group">
					<view class="title">熟练程度</view>
					<my-select range-key="text" value-key="value" dict-code="proficiency"
						v-model="dataObj.proficiency" />
				</view>
				<view class="cu-form-group">
					<view class="title">拟入职时间</view>
					<picker mode="date" :value="dataObj.proposedEmploymentDate"
						@change="DateChangeProposedEmploymentDate">
						<view class="picker">
							<!-- {{proposedEmploymentDate.replaceAll('-','/')}} -->
							{{proposedEmploymentDate}}
						</view>
					</picker>
				</view>
			</view>

			<view class="action" style="margin-bottom: 10px;margin-top: 30rpx;">
				<text class="cuIcon-titles " style="color: #1E5EFF;"></text>
				<text style="color: #5A607F;font-size: 25rpx;">
					宿舍信息填写
				</text>
			</view>

			<view style="margin-top: 35rpx;">
				<view class="cu-form-group">
					<view class="title">住宿方式</view>
					<my-select range-key="text" value-key="value" dict-code="accommodation_methods"
						v-model="dataObj.accommodationMethods" />
				</view>
				<view v-if="dataObj.accommodationMethods == '1'">
					<view class="cu-form-group">
						<view class="title">宿舍属性</view>
						<my-select range-key="text" value-key="value" dict-code="room_type"
							v-model="dataObj.roomType" />
					</view>
					<!-- <view class="cu-form-group">
						<view class="title">楼栋</view>
						<my-select range-key="text" value-key="value"
							dict-code="crm_dormitory_building,building_name,id" v-model="dataObj.buildingId" />
					</view>
					<view class="cu-form-group">
						<view class="title">楼层</view>
						<my-select range-key="text" value-key="value" dict-code="crm_dormitory_floor,floor,id"
							v-model="dataObj.floorId" />
					</view>
					<view class="cu-form-group">
						<view class="title">宿舍号</view>
						<my-select range-key="text" value-key="value" dict-code="crm_dormitory_room,room_code,id"
							v-model="dataObj.roomId" />
					</view> -->
					<view class="cu-form-group">
						<view class="title">楼栋/楼层/房间号</view>
						<myUniDataPicker ref="cascadeSelection" v-model="uniDataPicker"
							:buildingId='this.dataObj.buildingId' :floorId='this.dataObj.floorId'
							:roomCode='this.dataObj.roomCode' />
					</view>
				</view>
				<view v-if="dataObj.accommodationMethods == '2'">
					<view class="cu-form-group">
						<view class="title">现居住地址</view>
						<input v-model="dataObj.currentAddress" placeholder="请输入" name="input"
							style="text-align:right;font-size: 25rpx;" />
					</view>
				</view>
			</view>

			<view class="action" style="margin-bottom: 10px;margin-top: 30rpx;">
				<text class="cuIcon-titles " style="color: #1E5EFF;"></text>
				<text style="color: #5A607F;font-size: 25rpx;">
					职位信息填写
				</text>
			</view>
			<view style="margin-top: 35rpx;">
				<view class="cu-form-group" style="background-color: #E2E2E2;border-radius: 15px;margin-top: 15rpx;">
					<view class="title">公司</view>
					<input v-model="dataObj.company_dictText" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;" disabled />
				</view>
				<view class="cu-form-group">
					<view class="title">部门</view>
					
					<!-- <myPickerDept ref="cascadeSelectionDept" v-model="uniDeptDataPicker" @changeDept="changeDept" /> -->
					<view style="margin-left: 10px;overflow: hidden; width: 500rpx;font-size: 25rpx;!important">
					 <uni-data-picker :border="false" style="text-align:right;" placeholder="" :map="{text:'title',value:'id'}" popup-title="请选择部门" v-if="!deptLoading"
					 	:localdata="dataTree" v-model="uniDeptDataPicker"  @clear="clear" @changeDept="changeDept"  @change="onchange" @nodeclick="onnodeclick">
					 </uni-data-picker>
					 </view>
					</view>
				
				</view>
				<view class="cu-form-group" style="background-color: #E2E2E2;border-radius: 15px;margin-top: 15rpx;">
					<view class="title">分类</view>
					<input v-model="dataObj.classification" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;" disabled />
				</view>
				<view class="cu-form-group" style="background-color: #E2E2E2;border-radius: 15px;margin-top: 15rpx;">
					<view class="title">车间</view>
					<input v-model="dataObj.workshop" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;" disabled />
				</view>
				<view class="cu-form-group" style="background-color: #E2E2E2;border-radius: 15px;margin-top: 15rpx;">
					<view class="title">班次</view>
					<input v-model="dataObj.classes" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;" disabled />
				</view>
				<view class="cu-form-group" style="background-color: #E2E2E2;border-radius: 15px;margin-top: 15rpx;">
					<view class="title">岗位</view>
					<input v-model="dataObj.post" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;" disabled />
				</view>
				<!-- <view class="cu-form-group">
					<view class="title">车间</view>
					<my-select range-key="text" value-key="value" dict-code="workshop" v-model="dataObj.workshop" />
				</view>
				<view class="cu-form-group">
					<view class="title">班次</view>
					<my-select range-key="text" value-key="value" dict-code="classes" v-model="dataObj.classes" />
				</view>
				<view class="cu-form-group">
					<view class="title">岗位</view>
					<my-select range-key="text" value-key="value" dict-code="sys_position,name,code"
						v-model="dataObj.post" />
				</view> -->

				<view class="cu-form-group">
					<view class="title">工资/转正工资</view>
					<input v-model="dataObj.regularSalary" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;"></input>
				</view>
				<view class="cu-form-group">
					<view class="title">是否有试用期</view>
					<uni-data-checkbox v-model="dataObj.jobStatus" :localdata="isJobStatusRadio"
						style="margin-left: 20px;"></uni-data-checkbox>
				</view>
				<view class="cu-form-group" v-if="dataObj.jobStatus == 1">
					<view class="title">试用时长(月)</view>
					<input type="number" v-model="dataObj.probationPeriodDuration" placeholder="请输入" name="input"
						@input="changeRegularDate()" style="text-align:right;font-size: 25rpx;"></input>
				</view>
				<view class="cu-form-group" v-if="dataObj.jobStatus == 1">
					<view class="title">试用工资</view>
					<input v-model="dataObj.probationSalary" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;"></input>
				</view>
				<view class="cu-form-group" style="background-color: #E2E2E2;border-radius: 15px;margin-top: 15rpx;">
					<view class="title">转正时间</view>
					<!-- <input v-model="dataObj.regularDate.replaceAll('-','/')" placeholder="请输入" name="input"
						style="text-align:right;font-size: 25rpx;" disabled /> -->
						<input v-model="dataObj.regularDate" placeholder="请输入" name="input"
							style="text-align:right;font-size: 25rpx;" disabled />
				</view>
			</view>

			<view style="margin-top: 10px;">
				<view class="action" style="margin-bottom: 15px;">
					<text class="cuIcon-titles " style="color: #1E5EFF;"></text>
					<text style="color: #5A607F;font-size: 25rpx;">
						身份证信息正反面
					</text>
				</view>
				<view style="padding: 0 10rpx;">
					<view class="grid col-4 grid-square flex-sub">
						<view @tap="ChooseImageIdCard" v-if="imgListIdCard.length == 0"
							style="text-align: center;background: #F5F6FA;border-radius:10px;">
							<text class='cuIcon-add'></text>
						</view>
						<view class="bg-img" v-for="(item,index) in imgListIdCard" :key="index" @tap="ViewImageIdCard"
							style="border-radius:10px;" :data-url="imgListIdCard[index]">
							<image :src="imgListIdCard[index]" mode="aspectFill"></image>
							<view class="cu-tag addImgStyle" @tap.stop="DelImgIdCard" :data-index="index">
								<text class='cuIcon-delete' style="color: #FF3B3B;"></text>
							</view>
						</view>
					</view>
				</view>
			</view>

			<view style="margin-top: 10px;">
				<view class="action" style="margin-bottom: 15px;">
					<text class="cuIcon-titles " style="color: #1E5EFF;"></text>
					<text style="color: #5A607F;font-size: 25rpx;">
						荣誉/证书
					</text>
				</view>
				<view style="padding: 0 10rpx;">
					<view class="grid col-4 grid-square flex-sub">
						<view @tap="ChooseImageCertificate" v-if="imgListCertificate.length == 0"
							style="text-align: center;background: #F5F6FA;border-radius:10px;">
							<text class='cuIcon-add'></text>
						</view>
						<view class="bg-img" v-for="(item,index) in imgListCertificate" :key="index"
							@tap="ViewImageCertificate" style="border-radius:10px;"
							:data-url="imgListCertificate[index]">
							<image :src="imgListCertificate[index]" mode="aspectFill"></image>
							<view class="cu-tag addImgStyle" @tap.stop="DelImgCertificate" :data-index="index">
								<text class='cuIcon-delete' style="color: #FF3B3B;"></text>
							</view>
						</view>
					</view>
				</view>
			</view>

			<view style="margin-top: 10px;">
				<view class="action" style="margin-bottom: 5px;">
					<text class="cuIcon-titles " style="color: #1E5EFF;"></text>
					<text style="color: #5A607F;font-size: 25rpx;">
						家庭成员
					</text>
					<text @click="addFamilyList"
						style="float: right;padding: 8rpx 20rpx;background-color: rgba(69, 145, 254, 1);border-radius: 10rpx;color:#FFFFFF;">
						新增
					</text>
				</view>
				<view style="padding: 10px;" v-for="(item,index) in dataObj.familyMembers" :key="index">
					<view
						style="padding: 15rpx 30rpx;background-color: rgba(237, 233, 233, 1);border-radius: 10px 10px 0px 0px;text-align: right;">
						<text @click="deleteFamilyList(index)" class="cuIcon-delete" style="color: #FF3B3B;"></text>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">与本人关系</view>
						<!-- <input name="input" v-model="item.relationship"></input> -->
						<my-select range-key="text" value-key="value" dict-code="family_relationship"
							style="margin-right: 40rpx;" v-model="item.relationship" />
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">姓名</view>
						<input name="input" v-model="item.name"></input>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">电话</view>
						<input name="input" v-model="item.phone"></input>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;border-radius:  0px 0px 10px 10px;">
						<view class="title">单位</view>
						<input name="input" v-model="item.workUnit"></input>
					</view>
				</view>
			</view>

			<view style="margin-top: 10px;">
				<view class="action" style="margin-bottom: 5px;">
					<text class="cuIcon-titles " style="color: #1E5EFF;"></text>
					<text style="color: #5A607F;font-size: 25rpx;">
						进厂前工作经历
					</text>
					<text @click="addWorkExperienceList"
						style="float: right;padding: 8rpx 20rpx;background-color: rgba(69, 145, 254, 1);border-radius: 10rpx;color:#FFFFFF;">
						新增
					</text>
				</view>
				<view style="padding: 10px;" v-for="(item,index) in dataObj.resumes" :key="index">
					<view
						style="padding: 15rpx 30rpx;background-color: rgba(237, 233, 233, 1);border-radius: 10px 10px 0px 0px;text-align: right;">
						<text @click="deleteWorkExperienceList(index)" class="cuIcon-delete"
							style="color: #FF3B3B;"></text>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">单位名称</view>
						<input name="input" v-model="item.workUnit"></input>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">开始时间</view>
						<!-- <input name="input" v-model="item.startTime"></input> -->
						<picker mode="date" :value="item.startTime" @change="startTimeDateChange"
							@click="startTimeClick(index)">
							<view style="text-align:right;line-height: 15px;">
								<!-- {{item.startTime != '' ? item.startTime.replaceAll('-','/') : '请选择'}} -->
								{{item.startTime != '' ? item.startTime : '请选择'}}
							</view>
						</picker>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">结束时间</view>
						<!-- <input name="input" v-model="item.endTime"></input> -->
						<picker mode="date" :value="item.endTime" @change="endTimeDateChange"
							@click="endTimeClick(index)">
							<view style="text-align:right;line-height: 15px;">
								<!-- {{item.endTime != '' ? item.endTime.replaceAll('-','/') : '请选择'}} -->
								{{item.endTime != '' ? item.endTime : '请选择'}}
							</view>
						</picker>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;border-radius:  0px 0px 10px 10px;">
						<view class="title">职务</view>
						<input name="input" v-model="item.post"></input>
					</view>
				</view>
			</view>

			<view style="margin-top: 10px;">
				<view class="action" style="margin-bottom: 5px;">
					<text class="cuIcon-titles " style="color: #1E5EFF;"></text>
					<text style="color: #5A607F;font-size: 25rpx;">
						其他事项
					</text>
					<text @click="addOtherList"
						style="float: right;padding: 8rpx 20rpx;background-color: rgba(69, 145, 254, 1);border-radius: 10rpx;color:#FFFFFF;">
						新增
					</text>
				</view>
				<view style="padding: 10px;" v-for="(item,index) in dataObj.otherMatters" :key="index">
					<view
						style="padding: 15rpx 30rpx;background-color: rgba(237, 233, 233, 1);border-radius: 10px 10px 0px 0px;text-align: right;">
						<text @click="deleteOtherList(index)" class="cuIcon-delete" style="color: #FF3B3B;"></text>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">说明</view>
						<input name="input" v-model="item.reason"></input>
					</view>
					<!-- <view class="cu-form-group" style="background: #FAFAFA;border-radius:  0px 0px 10px 10px;">
						<view class="title">开始时间</view>
						<input name="input" v-model="item.time"></input>
					</view> -->
				</view>
			</view>

			<view style="margin-top: 10px;">
				<view class="action" style="margin-bottom: 5px;">
					<text class="cuIcon-titles " style="color: #1E5EFF;"></text>
					<text style="color: #5A607F;font-size: 25rpx;">
						在本公司期间获得的荣誉及奖惩情况（选填）
					</text>
					<text @click="addRewardsPunishmentsList"
						style="float: right;padding: 8rpx 20rpx;background-color: rgba(69, 145, 254, 1);border-radius: 10rpx;color:#FFFFFF;">
						新增
					</text>
				</view>
				<view style="padding: 10px;" v-for="(item,index) in dataObj.ourCompanyReceivesRewards" :key="index">
					<view
						style="padding: 15rpx 30rpx;background-color: rgba(237, 233, 233, 1);border-radius: 10px 10px 0px 0px;text-align: right;">
						<text @click="deleteRewardsPunishmentsList(index)" class="cuIcon-delete"
							style="color: #FF3B3B;"></text>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">奖/惩情况</view>
						<input name="input" v-model="item.rewards"></input>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">离职详情</view>
						<input name="input" v-model="item.leaveReason"></input>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;border-radius:  0px 0px 10px 10px;">
						<view class="title">详情</view>
						<input name="input" v-model="item.reason"></input>
					</view>
				</view>
			</view>

			<view style="margin-top: 10px;">
				<view class="action" style="margin-bottom: 5px;">
					<text class="cuIcon-titles " style="color: #1E5EFF;"></text>
					<text style="color: #5A607F;font-size: 25rpx;">
						在本公司的成长记录（选填）
					</text>
					<text @click="addGrowRecordList"
						style="float: right;padding: 8rpx 20rpx;background-color: rgba(69, 145, 254, 1);border-radius: 10rpx;color:#FFFFFF;">
						新增
					</text>
				</view>
				<view style="padding: 10px;" v-for="(item,index) in dataObj.growthRecords" :key="index">
					<view
						style="padding: 15rpx 30rpx;background-color: rgba(237, 233, 233, 1);border-radius: 10px 10px 0px 0px;text-align: right;">
						<text @click="deleteGrowRecordList(index)" class="cuIcon-delete" style="color: #FF3B3B;"></text>
					</view>
					<!-- <view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">时间</view>
						<input name="input" v-model="item.time"></input>
					</view> -->
					<view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">原因</view>
						<input name="input" v-model="item.reason"></input>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">详情</view>
						<input name="input" v-model="item.details"></input>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">转正详情</view>
						<input name="input" v-model="item.confirmationDetails"></input>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">调岗详情</view>
						<input name="input" v-model="item.job_transfer_details"></input>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">原部门</view>
						<input name="input" v-model="item.oriOrgCodeTxt"></input>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">原职务</view>
						<input name="input" v-model="item.oriPost"></input>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">现部门</view>
						<input name="input" v-model="item.orgCodeTxt"></input>
					</view>
					<view class="cu-form-group" style="background: #FAFAFA;border-radius:  0px 0px 10px 10px;">
						<view class="title">现职务</view>
						<input name="input" v-model="item.post"></input>
					</view>
				</view>
			</view>

			<view style="margin-top: 10px;">
				<view class="action" style="margin-bottom: 5px;">
					<text class="cuIcon-titles " style="color: #1E5EFF;"></text>
					<text style="color: #5A607F;font-size: 25rpx;">
						附属职务（选填）
					</text>
					<text @click="addAffiliatedPositionsList"
						style="float: right;padding: 8rpx 20rpx;background-color: rgba(69, 145, 254, 1);border-radius: 10rpx;color:#FFFFFF;">
						新增
					</text>
				</view>
				<view style="padding: 10px;" v-for="(item,index) in dataObj.subPosts" :key="index">
					<view
						style="padding: 15rpx 30rpx;background-color: rgba(237, 233, 233, 1);border-radius: 10px 10px 0px 0px;text-align: right;">
						<text @click="deleteAffiliatedPositionsList(index)" class="cuIcon-delete"
							style="color: #FF3B3B;"></text>
					</view>
					<view class="cu-form-group" style="background: #FFFFFF;">
						<view class="title">部门</view>
						<!-- <input name="input" v-model="item.orgCodeTxt"></input> -->
						<myPickerDept ref="cascadeSelectionDept1" style="width: 325px;" v-model="item.orgCodeTxtArr"
							@changeDept="(params) => {
							item.company = params.company
							item.post = params.post
						}" @getDeptIds="(val) =>{
								if (val.length > 0) {
									let deptIds = []
									val.forEach((item) => {
										deptIds.push(item.text)
									})
									item.orgCodeTxt = deptIds.join(',')
								}
							}" />
					</view>
					<view class="cu-form-group" style="background: #E2E2E2;">
						<view class="title">公司</view>
						<input name="input" v-model="item.company" disabled></input>
						<!-- <my-select range-key="text" value-key="value" dict-code="company"
							v-model="item.company" /> -->
					</view>
					<!-- <view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">选择职务</view>
						<input name="input" v-model="item.postLevel"></input>
					</view> -->
					<!-- <view class="cu-form-group" style="background: #FAFAFA;">
						<view class="title">职务类别</view>
						<input name="input" v-model="item.postType"></input>
						<my-select range-key="text" value-key="value" dict-code="accommodation_methods"
							v-model="item.postType" />
					</view> -->
					<view class="cu-form-group" style="background: #E2E2E2;">
						<view class="title">职务</view>
						<input name="input" v-model="item.post" disabled></input>
						<!-- <my-select range-key="text" value-key="value" dict-code="post_type"
							v-model="item.post" /> -->
					</view>
					<view class="cu-form-group" style="background: #FFFFFF;border-radius:  0px 0px 10px 10px;">
						<view class="title">职务等级</view>
						<!-- <input name="input" v-model="item.postType"></input> -->
						<my-select range-key="text" value-key="value" dict-code="post_type" v-model="item.postType" />
					</view>
					<view class="cu-form-group" style="background: #FFFFFF;">
						<view class="title">计费标准</view>
						<!-- <input name="input" v-model="item.freightBasis"></input> -->
						<my-select range-key="text" value-key="value" dict-code="freight_basis"
							v-model="item.freightBasis" />
					</view>
				</view>
			</view>

			<view style="display: flex;margin-top: 15px;justify-content: space-between;align-items: center;">
				<view @click="submit"
					style="padding: 30rpx 110rpx; margin-left: 20rpx;margin-top: 20rpx; background-color: rgba(30, 94, 255, 1);border-radius: 30rpx;color: #FFFFFF;">
					提交审核
				</view>
				<view @click="save"
					style="padding: 30rpx 110rpx;margin-left: 20rpx;margin-top: 20rpx;border-radius: 30rpx;background-color: rgba(255, 173, 4, 1); color: #FFFFFF;">
					保存
				</view>
			</view>

			<uni-popup ref="submitFlag" background-color="#fff" :mask-click="false">
				<view
					style="text-align: center;background-color: #FFFFFF;padding: 11rpx;width: 580rpx;height: 470rpx;border-radius: 42rpx;">
					<view>
						<view class="submit-item">
							<image class="submit-icon" src="@/static/duihaoblue.png" />
						</view>
						<view style="margin-top: 28rpx;">
							<text class="submit-text">入职申请已经提交</text>
						</view>
						<view style="color: rgba(150, 150, 150, 1); margin-top: 23rpx;">
							<text>已提醒审核人员进行审核</text>
						</view>
						<button @click="sureOne" style="border-radius: 20rpx; background-color: rgba(69, 145, 254, 1);
									color: rgba(255, 255, 255, 1);width: 300rpx;margin-top: 27rpx;">确定</button>
					</view>
				</view>
			</uni-popup>
			<uni-popup ref="draftsFlag" background-color="#fff" :mask-click="false">
				<view>
					<view
						style="text-align: center;background-color: #FFFFFF;padding: 11rpx;width: 580rpx;height: 470rpx;border-radius: 42rpx;">
						<view class="submit-item">
							<image class="submit-icon" src="@/static/drafts.png" />
						</view>
						<view style="margin-top: 28rpx;">
							<text class="submit-text">已保存进草稿箱</text>
						</view>
						<view style="color: rgba(150, 150, 150, 1); margin-top: 23rpx;">
							<text>您可以进入草稿箱查看</text>
						</view>
						<button @click="sureThree" style="border-radius: 20rpx; background-color: rgba(69, 145, 254, 1);
					color: rgba(255, 255, 255, 1);width: 300rpx;margin-top: 27rpx;">确定</button>
					</view>
				</view>
			</uni-popup>
		</view>
	</view>
</template>

<script>
	import moment from 'moment';
	import {
		forEach
	} from '../../../../../common/luch-request/utils';
	import configService from '@/common/service/config.service.js'
	export default {
		data() {
			return {
				screenHeight: uni.getSystemInfoSync().windowHeight,
				imgList: [],
				retirmAvatar: '',
				userId: '',
				id: '',
				userUrl: '/crm_user/crmUser/queryById',
				uploadUrl: "/sys/common/upload",
				uniDataPicker: '',
				uniDeptDataPicker: '',
				departFrom: '',
				isJobStatusRadio: [{
					text: '试用员工',
					value: 1
				}, {
					text: '转正员工',
					value: 2
				}],
				dataObj: {
					// id: Math.floor(Math.random() * 10000000000000000000) + Date.now(),
					approvalStatus: "1",
					userId: '',
					workNo: '',
					maritalStatus: '',
					sex: '',
					nation: '',
					nativePlace: '',
					birthday: '',
					age: '',
					education: '',
					partyAndLeagueMembers: '',
					phone: '',
					idCard: '',
					idCardValidPeriod: '',
					identityCategory: '',
					identityCategory_dictText: '',
					idCardAddress: '',
					idCardIssue: '',
					currentAddress: '',
					graduationInstitution: '',
					proficiency: '',
					regularDate: '',
					//宿舍信息
					roomType: '',
					buildingId: '',
					floorId: '',
					roomId: '',
					roomCode: '',
					//职位信息
					company: '',
					departIds: '',
					departTitle: '',
					departmentType: '',
					workshop: '',
					classes: '',
					post: '',
					postLevel: '',
					positionAttribution: '',
					staffStatus: '',
					inTime: '',
					onboardingMethods: '',
					accommodationMethods: '1',
					probationPeriodDuration: '',
					probationSalary: '',
					regularSalary: '',
					jobStatus: 1,
					//家庭成员
					familyMembers: [],
					//进厂前工作经历
					resumes: [],
					//其他事项
					otherMatters: [],
					//在本公司期间获得的荣誉及奖惩情况（选填）
					ourCompanyReceivesRewards: [],
					//在本公司的成长记录（选填）
					growthRecords: [],
					//附属职务（选填）
					subPosts: [],
					idCardImgList: [],
					honors: []
				},
				selStartTimeIndex: 0,
				selEndTimeIndex: 0,
				proposedEmploymentDate: moment().format('YYYY-MM-DD'),
				imgListIdCard: [],
				imgListCertificate: [],
				graduationTime: '',
				enterFactoryTime: '',
				deptLoading:false,
				dataTree:[]
			}
		},
		onLoad(options) {
			// uni.$on('departCallBack', (data) => {
			// 	this.$set(this.dataObj, 'departIds', data?.idArray?.join(','))
			// 	this.$set(this.dataObj, 'departTitle', data?.titleArray?.join('>'))
			// })
			this.id = options.id;
			this.userId = options.userId
			if (options.dataObj) {
				let item = JSON.parse(options.dataObj)
				this.dataObj = item
				this.dataObj.workNo = item.workNo
				this.dataObj.maritalStatus = item.maritalStatus
				this.dataObj.buildingId = item.buildingId
				this.dataObj.floorId = item.floorId
				this.dataObj.roomId = item.roomId
				this.dataObj.company = item.company
				this.dataObj.departTitle = item.orgCodeTxt
				this.dataObj.workshop = item.workshop
				this.dataObj.classes = item.classes
				this.dataObj.post = item.post
				this.dataObj.jobStatus = parseInt(item.jobStatus)
				this.dataObj.accommodationMethods = item.accommodationMethods
				this.getDetail()
			}
		},
		mounted() {
			this.getBuildingData()
		},
		watch: {
			userId: {
				immediate: true,
				handler(val, old) {
					console.log("dataObject.userId值变化")
					console.log(val)
					console.log(old)
					this.dataObj.userId = val;
					this.queryUserByUserId()
				},
			},
			'dataObj.roomType': {
				immediate: true,
				handler(val, old) {
					console.log(val)
					if (this.$refs.cascadeSelection) {
						this.$refs.cascadeSelection.getCascadeData(val);
						setTimeout(() => {
							console.log(this.dataObj.roomCode)
							this.$refs.cascadeSelection.setDataValue(this.dataObj.roomCode);
						},500)
					}
				},
			},
			'dataObj.departIds': {
				immediate: true,
				handler(val, old) {
					console.log(val)
					if (this.$refs.cascadeSelectionDept) {
						setTimeout(() => {
							let departIdsList = val.split(',')
							this.$refs.cascadeSelectionDept.setDataValue(departIdsList[departIdsList.length - 1]);
						},500)
					}
				},
			},
			uniDataPicker: {
				immediate: true,
				handler(val, old) {
					if (val.length > 0) {
						this.dataObj.buildingId = val[0].value
						this.dataObj.floorId = val[1].value
						this.dataObj.roomCode = val[2].value
					}
				},
			},
			uniDeptDataPicker: {
				immediate: true,
				handler(val, old) {
					if (val.length > 0) {
						let deptIds = []
						val.forEach((item) => {
							deptIds.push(item.value)
						})
						this.dataObj.departIds = deptIds.join(',')
						this.$http.post(
								'/crm_employment_application/crmEmploymentApplication/generateWorkNo/', {
									"company": this.dataObj.company,
									"departIds": this.dataObj.departIds,
									"idCard": this.dataObj.idCard
								})
							.then(res => {
								console.log('获取工号-handler',res)
								if (res.data.success) {
									this.dataObj.workNo = res.data.result
								} else {
									this.$tip.toast('获取失败')
								}
							}).catch(() => {
								this.$tip.loaded();
								this.$tip.toast('获取失败')
							});
					}
				},
			}
		},
		computed: {

		},
		methods: {
			getTree(){
				this.deptLoading = true
				
					this.$http.get('/sys/sysDepart/queryTreeList').then((res) => {
						if (res.data.success) {
							console.log('getDeptData',res.data)
							this.dataTree = res.data.result
							this.deptLoading = false
						}
					})
			},
			onnodeclick(e) {
				console.log('eee',e);
				if (e.orgCategory == 5) {
					this.dataObj.workshop = e.title
				} else if (e.orgCategory == 7) {
					this.dataObj.classification = e.title
				} else if (e.orgCategory == 6) {
					this.dataObj.classes = e.title
				} else if (e.orgCategory == 3) {
					this.dataObj.post = e.title
					this.dataObj.freightBasis = e.freightBasis
					this.dataObj.postType = e.postType
				} else if (e.orgCategory == 1) {
					this.dataObj.company_dictText = e.title
					this.dataObj.company = e.id
				}
			},
			clear(){},
			onchange(e){
				console.log('onchange--',e)
				this.uniDeptDataPicker = e.detail.value
			
				
				console.log('this.uniDeptDataShow',this.uniDeptDataShow)
			},
			DateChangeProposedEmploymentDate(){},
			DateChangeGraduationTime(e){
				this.graduationTime = e.detail.value
				this.dataObj.graduationTime = e.detail.value
			},
			DateChangeEnterFactoryTime(e){
				this.enterFactoryTime = e.detail.value
				this.dataObj.enterFactoryTime = e.detail.value
			},
			getDetail() {
				this.$http.get(
						"/crm_employment_application/crmEmploymentApplication/queryEmploymentApplicationDetail/" +
						this.id)
					.then(res => {
						if (res.data.success) {
							console.log(res.data)
							this.dataObj = res.data.result
							console.log(2222)
							// this.dataObj.workNo = res.data.result.workNo
							// this.dataObj.nativePlace = res.data.result.nativePlace
							// this.dataObj.education = res.data.result.education
							// this.dataObj.partyAndLeagueMembers = res.data.result.partyAndLeagueMembers
							// this.dataObj.phone = res.data.result.phone
							// this.dataObj.currentAddress = res.data.result.currentAddress
							// this.dataObj.graduationInstitution = res.data.result.graduationInstitution
							// this.dataObj.familyMembers = res.data.result.familyMembers
							// this.dataObj.resumes = res.data.result.resumes
							// this.dataObj.otherMatters = res.data.result.otherMatters
							// this.dataObj.ourCompanyReceivesRewards = res.data.result.ourCompanyReceivesRewards
							// this.dataObj.growthRecords = res.data.result.growthRecords
							// this.dataObj.subPosts = res.data.result.subPosts
							// this.dataObj.workNo = res.data.result.workNo
							this.retirmAvatar = this.getFileAccessHttpUrl(res.data.result.avatar)
							if(this.dataObj.company) {
								this.deptLoading = true
								let params = {};
								if (this.dataObj.company != '' && this.dataObj.company != '') {
									params = {
										company: this.dataObj.company
									}
								}
								this.$http.get('/sys/sysDepart/queryTreeListTileChangeTree', {
									params: params
								}).then((res) => {
									if (res.data.success) {
										console.log('getDeptDataNew',res.data)
										this.dataTree = res.data.result.tree
										this.deptLoading = false
									}
								})
							} else {
								this.deptLoading = true
								
									this.$http.get('/sys/sysDepart/queryTreeList').then((res) => {
										if (res.data.success) {
											console.log('getDeptData',res.data)
											this.dataTree = res.data.result
											this.deptLoading = false
										}
									})
							}
						}
					})
			},
			getFileAccessHttpUrl(avatar, subStr) {
				if (!subStr) subStr = 'http'
				if (avatar && avatar.startsWith(subStr)) {
					return avatar;
				} else {
					return configService.staticDomainURL + "/" + avatar;
				}
			},
			ChooseDepartIds(from = '') {
				this.departFrom = from;
				uni.navigateTo({
					url: '/pages/oa/common/depart',
				});
			},
			queryUserByUserId() {
				this.$http.get(this.userUrl, {
					params: {
						id: this.userId
					}
				}).then(res => {
					console.log("res", res)
					if (res.data.success) {
						let data = res.data.result
						// this.dataObj.workNo = data.workNo;
						this.dataObj.maritalStatus = data.maritalStatus;
						this.dataObj.maritalStatus_dictText = data.maritalStatus_dictText;
						this.dataObj.sex = data.sex;
						this.dataObj.sex_dictText = data.sex_dictText;
						this.dataObj.nation = data.nation;
						// this.dataObj.nativePlace = data.nativePlace;
						this.dataObj.birthday = data.birthday;
						this.dataObj.age = data.age;
						this.dataObj.idCard = data.idCard;
						this.dataObj.idCardAddress = data.idCardAddress;
						this.dataObj.idCardIssue = data.idCardIssue;
						this.dataObj.idCardValidPeriod = data.idCardValidPeriod;
						this.dataObj.identityCategory = data.identityCategory;
						this.dataObj.identityCategory_dictText = data.identityCategory_dictText;
					}
				}).catch(err => {
					console.log(err);
				});
			},
			getpost(code) {
				if (!code || code.length == 0) {
					this.personalList.post = '员工'
					return false;
				}
				this.$http.get(this.postUrl, {
					params: {
						code: code
					}
				}).then(res => {
					console.log("postUrl", res)
					if (res.data.success) {
						this.personalList.post = res.data.result.name
					}
				}).catch(err => {
					console.log(err);
				});

			},
			ChooseImage() {
				var that = this;
				uni.chooseImage({
					count: 4, //默认9
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album'], //从相册选择
					success: (res) => {
						console.log("1111111111111111111111")
						console.log(that.uploadUrl)
						console.log(that.$config.apiUrl)
						that.$http.upload(that.$config.apiUrl + that.uploadUrl, {
							filePath: res.tempFilePaths[0],
							name: 'file'
						}).then(res => {
							that.dataObj.avatar = res.data.message;
						}).catch(err => {
							that.$tip.error(err.data.message)
						});
						this.imgList = res.tempFilePaths
					}
				});
			},
			ViewImage(e) {
				uni.previewImage({
					urls: this.imgList,
					current: e.currentTarget.dataset.url
				});
			},
			DelImg(e) {
				uni.showModal({
					title: '提示',
					content: '确定要删除吗？',
					cancelText: '取消',
					confirmText: '确定',
					success: res => {
						if (res.confirm) {
							this.imgList.splice(e.currentTarget.dataset.index, 1)
						}
					}
				})
			},
			ChooseImageIdCard() {
				var that = this;
				uni.chooseImage({
					count: 4, //默认9
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album'], //从相册选择
					success: (res) => {
						console.log("1111111111111111111111")
						console.log(that.uploadUrl)
						console.log(that.$config.apiUrl)
						// that.$http.upload(that.$config.apiUrl + that.uploadUrl, {
						// 	filePath: res.tempFilePaths[0],
						// 	name: 'file'
						// }).then(res => {
						// 	that.dataObj.avatar = res.data.message;
						// }).catch(err => {
						// 	that.$tip.error(err.data.message)
						// });
						this.imgListIdCard = res.tempFilePaths
					}
				});
			},
			ViewImageIdCard(e) {
				uni.previewImage({
					urls: this.imgListIdCard,
					current: e.currentTarget.dataset.url
				});
			},
			DelImgIdCard(e) {
				uni.showModal({
					title: '提示',
					content: '确定要删除吗？',
					cancelText: '取消',
					confirmText: '确定',
					success: res => {
						if (res.confirm) {
							this.imgListIdCard.splice(e.currentTarget.dataset.index, 1)
						}
					}
				})
			},
			ChooseImageCertificate() {
				var that = this;
				uni.chooseImage({
					count: 4, //默认9
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album'], //从相册选择
					success: (res) => {
						console.log("1111111111111111111111")
						console.log(that.uploadUrl)
						console.log(that.$config.apiUrl)
						// that.$http.upload(that.$config.apiUrl + that.uploadUrl, {
						// 	filePath: res.tempFilePaths[0],
						// 	name: 'file'
						// }).then(res => {
						// 	that.dataObj.avatar = res.data.message;
						// }).catch(err => {
						// 	that.$tip.error(err.data.message)
						// });
						this.imgListCertificate = res.tempFilePaths
					}
				});
			},
			ViewImageCertificate(e) {
				uni.previewImage({
					urls: this.imgListCertificate,
					current: e.currentTarget.dataset.url
				});
			},
			DelImgCertificate(e) {
				uni.showModal({
					title: '提示',
					content: '确定要删除吗？',
					cancelText: '取消',
					confirmText: '确定',
					success: res => {
						if (res.confirm) {
							this.imgListCertificate.splice(e.currentTarget.dataset.index, 1)
						}
					}
				})
			},
			//家庭成员
			addFamilyList() {
				this.dataObj.familyMembers.push({
					relationship: '',
					name: '',
					phone: '',
					workUnit: '',
				})
			},
			deleteFamilyList(index) {
				this.dataObj.familyMembers.splice(index, 1);
			},
			//进厂前工作经历
			addWorkExperienceList() {
				this.dataObj.resumes.push({
					workUnit: '',
					startTime: '',
					endTime: '',
					post: '',
				})
			},
			deleteWorkExperienceList(index) {
				this.dataObj.resumes.splice(index, 1);
			},
			//其他事项
			addOtherList() {
				this.dataObj.otherMatters.push({
					reason: '',
				})
			},
			deleteOtherList(index) {
				this.dataObj.otherMatters.splice(index, 1);
			},
			//在本公司期间获得的荣誉及奖惩情况（选填）
			addRewardsPunishmentsList() {
				this.dataObj.ourCompanyReceivesRewards.push({
					rewards: '',
					leaveReason: '',
					reason: '',
				})
			},
			deleteRewardsPunishmentsList(index) {
				this.dataObj.ourCompanyReceivesRewards.splice(index, 1);
			},
			//在本公司的成长记录（选填）
			addGrowRecordList() {
				this.dataObj.growthRecords.push({
					time: '',
					reason: '',
					details: '',
					confirmationDetails: '',
					job_transfer_details: '',
					oriOrgCodeTxt: '',
					oriPost: '',
					post: '',
					orgCodeTxt: '',
				})
			},
			deleteGrowRecordList(index) {
				this.dataObj.growthRecords.splice(index, 1);
			},
			addAffiliatedPositionsList() {
				this.dataObj.subPosts.push({
					company: '',
					orgCodeTxt: '',
					postLevel: '',
					postType: '',
					post: '',
					freightBasis: '',
					positionLevel: '',
				})
			},
			deleteAffiliatedPositionsList(index) {
				this.dataObj.subPosts.splice(index, 1);
			},
			async submit() {
				if (this.imgListCertificate.length > 0) {
					await this.uploadImgListCertificate(this.imgListCertificate)
				}
				await this.$http.put('/crm_employment_application/crmEmploymentApplication/edit', this.dataObj).then(
					res => {
						if (res.data.success) {
							setTimeout(() => {
								this.$http.post(
										'/crm_employment_application/crmEmploymentApplication/submitTrial/' +
										this.dataObj.id)
									.then(res => {
										if (res.data.success) {
											this.$refs.submitFlag.open('center')
										} else {
											this.$tip.toast('提交审核失败')
										}
									}).catch(() => {
										this.$tip.loaded();
										this.$tip.toast('提交审核失败')
									});
							}, 100)
						} else {
							this.$tip.toast(res.data.message)
						}
					}).catch(() => {
					this.$tip.loaded();
					this.$tip.toast('提交失败')
				});
			},
			async uploadImgListIdCard(imgList) {
				imgList.forEach((item, index) => {
					that.$http.upload(that.$config.apiUrl + that.uploadUrl, {
						filePath: imgList[index],
						name: 'file'
					}).then(res => {
						that.dataObj.idCardImgList.push({
							honorFile: res.data.message
						})
					}).catch(err => {
						that.$tip.error(err.data.message)
					});
				})
			},
			async uploadImgListCertificate(imgList) {
				const that = this
				imgList.forEach((item, index) => {
					that.$http.upload(that.$config.apiUrl + that.uploadUrl, {
						filePath: imgList[index],
						name: 'file'
					}).then(res => {
						that.dataObj.honors.push({
							files: res.data.message
						})
					}).catch(err => {
						that.$tip.error(err.data.message)
					});
				})
			},
			sureOne() {
				this.$refs.submitFlag.close()
				uni.navigateTo({
					url: '/pages/oa/crm_employment_list/index'
				})
			},
			async save() {
				await this.uploadImgListCertificate(this.imgListCertificate)
				await this.$http.put('/crm_employment_application/crmEmploymentApplication/edit', this.dataObj).then(
					res => {
						if (res.data.success) {
							this.$refs.draftsFlag.open('center')
						} else {
							this.$tip.toast(res.data.message)
						}
					}).catch(() => {
					this.$tip.loaded();
					this.$tip.toast('提交失败')
				});
			},
			sureThree() {
				this.$refs.draftsFlag.close()
				uni.navigateTo({
					url: '/pages/oa/crm_employment_list/employmentDrafts/index'
				})
			},
			getBuildingData() {
				this.$http.get('/crm_dormitory_building/crmDormitoryBuilding/queryAllDormitoryBuildingsInfo', {}).then(
					res => {
						console.log(res)
					})
			},
			changeDept(item) {
				this.dataObj.classification = item.classification
			},
			//计算转正时间
			changeRegularDate() {
				if (this.proposedEmploymentDate && this.dataObj.probationPeriodDuration) {
					const dateObj = new Date(this.proposedEmploymentDate)
					const newMonth = parseInt(this.dataObj.probationPeriodDuration)
					dateObj.setMonth(dateObj.getMonth() + newMonth)
					const year = dateObj.getFullYear()
					const month = (dateObj.getMonth() + 1).toString().padStart(2, '0')
					const day = dateObj
						.getDate()
						.toString()
						.padStart(2, '0')
					this.dataObj.regularDate = `${year}-${month}-${day}`
				}
			},
			startTimeDateChange(e) {
				this.dataObj.resumes[this.selStartTimeIndex].startTime = e.detail.value
			},
			startTimeClick(index) {
				this.selStartTimeIndex = index
			},
			endTimeDateChange(e) {
				this.dataObj.resumes[this.selEndTimeIndex].endTime = e.detail.value
			},
			endTimeClick(index) {
				this.selEndTimeIndex = index
			}
		}
	}
</script>

<style>
	.cu-form-group {
		background-color: #ffffff;
		line-height: 15px;
		padding: 0.5px 15px;
		display: flex;
		align-items: center;
		min-height: 42px;
		justify-content: space-between;
	}

	#topView .grid.grid-square>uni-view>uni-text[class*="cuIcon-"] {
		font-size: 27px;
		position: absolute;
		color: #8799a3;
		margin: auto;
		top: -10px;
		bottom: 0;
		left: 0;
		right: 0;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
	}

	.addImgStyle {
		background: rgba(255, 255, 255, 0.63) !important;
		border-radius: 6px 0px 7px 0px;
		position: absolute;
		left: 0;
		width: 25px;
		height: 15px;
		font-size: 10px;
	}

	.submit-wrap {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 2100rpx;
		background-color: rgba(3, 3, 3, 0.28);
		z-index: 10000;
	}

	.submit-box {
		padding: 11rpx;
		width: 580rpx;
		height: 470rpx;
		border-radius: 42rpx;
		position: absolute;
		right: 86rpx;
		background-color: #FFFFFF;
		margin-top: 888rpx;
		text-align: center;
	}

	.submit-item {}

	.submit-text {

		font-size: 32rpx;
	}

	.submit-icon {
		width: 118rpx;
		height: 118rpx;
		margin-top: 58rpx;
	}

	.cu-form-group uni-picker .picker {
		line-height: 15px;
		font-size: 15px;
		text-overflow: ellipsis;
		white-space: nowrap;
		overflow: hidden;
		width: 100%;
		text-align: right;
	}

	.cu-form-group uni-picker::after {
		font-family: cuIcon;
		line-height: 15px;
		display: block;
		content: "\e6a3";
		position: absolute;
		font-size: 12px;
		color: #8799a3;
		width: 31px;
		text-align: center;
		top: 0;
		bottom: 0;
		right: -10rpx;
		margin: auto;
	}

	/deep/ .uni-radio-input {
		width: 15px;
		height: 15px;
	}

	.nav-right-image {
		width: 40rpx;
		height: 40rpx;
		margin-left: 15px;
	}

	.title {
		font-size: 25rpx;
		color: #101317;
	}

	.actionAccommodation {
		background: #4591FE;
		padding: 10rpx 30rpx;
		border-radius: 20rpx;
		color: #FFFFFF;
		margin-right: 15rpx;
	}

	.unActionAccommodation {
		background: #DBDBDB;
		padding: 10rpx 30rpx;
		border-radius: 20rpx;
		color: #FFFFFF;
		margin-right: 15rpx;
	}
</style>
